﻿using System;
using System.Collections.Generic;
using System.Text;

namespace BaseData
{
    /// <summary>
    /// 业务类型
    /// </summary>
    public enum BusinessType
    {
        DBRead, DBWrite, DBAdmin, DBemailSystem
    }

    /// <summary>
    /// 用户类型
    /// </summary>
    public enum UserType
    {
        /// <summary>
        /// 局长
        /// </summary>
        JuZhang = 101,
        /// <summary>
        /// 科长
        /// </summary>
        KeZhang = 102,
        /// <summary>
        /// 分局长
        /// </summary>
        FenJuZhang = 103,
        /// <summary>
        /// 税政人员
        /// </summary>
        ShuiZheng = 104,
        /// <summary>
        /// 税收管理员
        /// </summary>
        ShuiShouManager = 105,
        /// <summary>
        /// 系统管理员
        /// </summary>
        SysManager = 106,
        /// <summary>
        /// 系统管理员
        /// </summary>
        ShuizhengKezhang = 107,
        /// <summary>
        /// 超级管理员
        /// </summary>
        SuperManager = 108,
    }


    public class Base
    {
        /// <summary>
        /// 根据业务类型返回数据库连接字符串名称
        /// </summary>
        /// <param name="businessType">业务类型</param>
        /// <returns>数据库连接字符串名称</returns>
        protected static string GetConnectionStr(BusinessType businessType)
        {
            string connstr = string.Empty;
            switch (businessType)
            {
                case BusinessType.DBRead:
                    connstr = "DBRead";
                    break;
                case BusinessType.DBWrite:
                    connstr = "DBWrite";
                    break;
                case BusinessType.DBAdmin:
                    connstr = "DBAdmin";
                    break;
                case BusinessType.DBemailSystem:
                    connstr = "DBemailSystem";
                    break;
                default:
                    break;
            }

            return connstr;
        }
    }
}